home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
rjs.lha
/
RJS
/
String
/
src
/
except.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-14
|
831b
|
48 lines
#include "String.h"
RJS_String RJS_String::except(int pos,int len)
{
if ((pos<0) || (len<0) || (pos+len > length()))
return *this;
else
return before(pos)+from(pos+len);
}
RJS_String RJS_String::except(char c)
{
int pos=index(c);
if (pos==-1) return *this;
else return before(pos)+after(pos);
}
RJS_String RJS_String::except(const char *s)
{
int slen=RJS_String::length(s);
int pos=index(s);
if (pos==-1) return *this;
else return before(pos)+from(pos+slen);
}
RJS_String RJS_String::except(const RJS_String &s)
{
int pos=index(s);
if (pos==-1) return *this;
else return before(pos)+from(int(pos+s.length()));
}
RJS_String RJS_String::except(const RJS_StringSearch &ss)
{
int ss_len,ss_pos;
find(ss,ss_pos,ss_len);
if (ss_pos==-1) return *this;
else return before(ss_pos)+from(ss_pos+ss_len);
}